//
//  LSZSignRecordContentTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/6/8.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZSignRecordContentTableViewCell.h"

@implementation LSZSignRecordContentTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewHeader = [[UIImageView alloc]init];
        [self.imageViewHeader.layer  setMasksToBounds:YES];
        [self addSubview:self.imageViewHeader];

        self.labelName = [[UILabel alloc]init];
        self.labelName.textColor = RGBColor(86, 145, 238);
        [self addSubview:self.labelName];

        self.labelConten = [[UILabel alloc]init];
        self.labelConten.textColor = titleColorLSZ;
        self.labelConten.numberOfLines = 0;
        [self addSubview:self.labelConten];

        self.labelTime = [[UILabel alloc]init];
        self.labelTime.textColor = lightColor;
//        self.labelTime.backgroundColor = [UIColor redColor];
        [self addSubview:self.labelTime];

        self.butZan = [[UIButton alloc]init];
//        self.butZan.backgroundColor = [UIColor yellowColor];
        [self addSubview:self.butZan];
        self.imageViewZan = [[UIImageView alloc]init];
        self.imageViewZan.image = [UIImage imageNamed:@"我的_签到_留言_点赞"];
        [self.butZan addSubview:self.imageViewZan];

        self.labelZan = [[UILabel alloc]init];
        self.labelZan.textColor = lightColor;
//        self.labelZan.backgroundColor = [UIColor yellowColor];
        [self.butZan addSubview:self.labelZan];

        if (ScreenWidth == 320) {
            //5
//            w__13+42+8+15
            //h____13+4+14+8+x+15+11+13
            self.labelName.font = FONT_(14.5);
            self.labelConten.font = FONT_(13.5);
            self.labelTime.font = FONT_(12.5);

            self.imageViewHeader.frame = CGRectMake(13,13,42, 42);
            [self.imageViewHeader.layer setCornerRadius:self.imageViewHeader.frame.size.height/2];
            self.labelName.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMinY(self.imageViewHeader.frame)+4, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-6-15, 14);
            self.labelConten.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMaxY(self.labelName.frame)+8, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-15-6, 20);
            self.labelTime.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMaxY(self.labelConten.frame)+15, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-15-6, 11);

            self.butZan.frame = CGRectMake(ScreenWidth-40-10, CGRectGetMaxY(self.labelConten.frame)+5, 50, 27);
            self.imageViewZan.frame = CGRectMake(10,6, 15, 15);
            self.labelZan.font = FONT_(12.5);
            self.labelZan.frame = CGRectMake(CGRectGetMaxX(self.imageViewZan.frame)+2, 7, self.butZan.frame.size.width- CGRectGetMaxX(self.imageViewZan.frame)-2, 17);

        }else if(ScreenWidth == 375){
            // 6 7
//w____10+45
            //h____15+5+16+10+x+15+13+15
            self.labelName.font = FONT_(15);
            self.labelConten.font = FONT_(14);
            self.labelTime.font = FONT_(13);

            self.imageViewHeader.frame = CGRectMake(15,15,45, 45);
            [self.imageViewHeader.layer setCornerRadius:self.imageViewHeader.frame.size.height/2];
            self.labelName.frame = CGRectMake(8+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMinY(self.imageViewHeader.frame)+5, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-23, 16);
            self.labelConten.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMaxY(self.labelName.frame)+10,  ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-15-6, 20);

            self.labelTime.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMaxY(self.labelConten.frame)+15, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-15-6, 13);
            self.butZan.frame = CGRectMake(ScreenWidth-40-10, CGRectGetMaxY(self.labelConten.frame)+10, 40, 27);
            self.imageViewZan.frame = CGRectMake(10, 10, 17, 14);

            self.butZan.frame = CGRectMake(ScreenWidth-40-10-10, CGRectGetMaxY(self.labelConten.frame)+10, 60, 27);
            self.imageViewZan.frame = CGRectMake(10,5, 17, 17);
            self.labelZan.font = FONT_(13);
            self.labelZan.frame = CGRectMake(CGRectGetMaxX(self.imageViewZan.frame)+2, 7, self.butZan.frame.size.width- CGRectGetMaxX(self.imageViewZan.frame)-2, 17);
        }else {
            //plus
            //w____10+47
            //h___15+7+18+10+x+15+15+15
            self.labelName.font = FONT_(15.5);
            self.labelConten.font = FONT_(14.5);
            self.labelTime.font = FONT_(13.5);

            self.imageViewHeader.frame = CGRectMake(15,15,47, 47);
            [self.imageViewHeader.layer setCornerRadius:self.imageViewHeader.frame.size.height/2];
            self.labelName.frame = CGRectMake(9+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMinY(self.imageViewHeader.frame)+7, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-23-1, 18);
            self.labelConten.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMaxY(self.labelName.frame)+10,  ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-15-6, 22);
            self.labelTime.frame = CGRectMake(6+CGRectGetMaxX(self.imageViewHeader.frame), CGRectGetMaxY(self.labelConten.frame)+15, ScreenWidth-CGRectGetMaxX(self.imageViewHeader.frame)-15-6, 15);

            self.butZan.frame = CGRectMake(ScreenWidth-40-10, CGRectGetMaxY(self.labelConten.frame)+10, 40, 27);
            self.imageViewZan.frame = CGRectMake(10, 10, 17, 14);

            self.butZan.frame = CGRectMake(ScreenWidth-40-10-15, CGRectGetMaxY(self.labelConten.frame)+10, 65, 27);
            self.imageViewZan.frame = CGRectMake(10,5, 17, 17);
            self.labelZan.font = FONT_(13.5);
            self.labelZan.frame = CGRectMake(CGRectGetMaxX(self.imageViewZan.frame)+2, 7, self.butZan.frame.size.width- CGRectGetMaxX(self.imageViewZan.frame)-2, 17);
        }

    }
    return self;
}

@end
